package com.zlzxm.shoesmarket.view.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.zlzxm.shoesmarket.R;
import com.zlzxm.shoesmarket.view.adapter.entity.EntityRepositoryInfo;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * CREATE BY zlzxm ON 4/8/21
 */
public class ADRepositoryInfo extends BaseQuickAdapter<EntityRepositoryInfo, BaseViewHolder> {

    public ADRepositoryInfo(@Nullable List<EntityRepositoryInfo> data) {
        super(R.layout.item_repository_info, data);
    }


    @Override
    protected void convert(@NotNull BaseViewHolder holder, EntityRepositoryInfo entity) {

        holder.setText(R.id.tvTitle,entity.getTitle());

        String desc = entity.getDesc();

        if(TextUtils.isEmpty(desc)){

            desc = "0";
        }

        holder.setText(R.id.tvDesc,desc);

    }
}
